<?php
$key = $form_view_config['key'];
$value='';
if(isset($result->$key)){
	if($form_view_config['type'] == 'password'){
		$value = '';
	}
	else{
		$value = $result->$key;
	}
}
?>
<div class="row_text_field">
	<table cellspacing="0" cellpadding="0" border="0" width="100%">
		<tr>
			<td class="left_text_field"><?=$form_view_config['text']?>:</td>
			<td class="right_text_field">
			<?php
			if(!empty($form_view_config['datetime_type'])){ // DATETIME VALUE
				$datetime_value = '';
				switch($form_view_config['datetime_type']){
					case 'datetime':
						$datetime_value = getVNDateTime($value,array('show_time_second'=>false));
						break;
					case 'date':
						$datetime_value = getVNDateTime($value,array('show_time'=>false));
						break;
					case 'time':
						$datetime_value = getVNDateTime($value,array('show_date'=>false,'show_time'=>true,'show_time_second'=>false));
						break;
				}
			?>
				<input onkeypress="return enterSearch(event)" type="<?=$form_view_config['type']?>" value="<?=$datetime_value?>" name="<?=$form_view_config['name']?>" id="<?=$form_view_config['name']?>" />
				<script>
				<?php
				switch($form_view_config['datetime_type']){
					case 'datetime':
				?>
						$("#<?=$form_view_config['name']?>").datetimepicker({
							controlType: 'select',
							dateFormat : "dd-mm-yy"
						});
				<?php
						break;
					case 'date':
				?>
						$("#<?=$form_view_config['name']?>").datepicker({
							changeMonth : true,
							changeYear : true,
							dateFormat : "dd-mm-yy",
							controlType: 'select'
						});
				<?php
						break;
					case 'time':
				?>
						$("#<?=$form_view_config['name']?>").timepicker({
							controlType: 'select'
						});
				<?php
						break;
				}
				?>
				</script>
			<?php 
			} else { // DEFAULT TEXT VALUE
			?>
				<input  type="<?=$form_view_config['type']?>" value="<?=$value?>" id="<?=$form_view_config['name']?>" name="<?=$form_view_config['name']?>" />
			<?php 
			}
			?>
			</td>
		</tr>
	</table>
</div>